# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=eclib
pkgver=20230424
pkgrel=3
pkgdesc='Includes mwrank (for 2-descent on elliptic curves over Q) and modular symbol code used to create the elliptic curve database'
arch=(loong64 x86_64)
url='https://github.com/JohnCremona/eclib/'
license=(GPL)
depends=(boost-libs
         flint
         gcc-libs
         glibc
         ntl
         pari)
makedepends=(boost)
source=(https://github.com/JohnCremona/eclib/releases/download/v$pkgver/$pkgname-$pkgver.tar.bz2)
sha256sums=('1422decfcabebb0ad42f7f58c5aefe5bd8fa11757b45e31a186384fd037cd5c1')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --with-flint=/usr --with-boost
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool # Fix overlinking
  make
}

package() {
  cd $pkgname-$pkgver
  make install DESTDIR="$pkgdir"
}
